1. Field of the Invention
The present invention relates to a wireless communication apparatus and a control method therefor and, more particularly, to a communication control technique when a wireless communication network is built in the wireless communication apparatus.
2. Description of the Related Art
In recent years, electronic apparatuses functioning as wireless LAN terminals have appeared. A wireless communication network made up of such electronic apparatuses includes an infrastructure mode network including a base station and wireless LAN terminals existing in the wireless cell of the base station and an ad hoc mode network including only wireless LAN terminals.
In the ad hoc mode network, the electronic apparatuses can directly communicate with each other without any base station. To build a wireless communication network by an electronic apparatus functioning as a wireless LAN terminal, therefore, the ad hoc mode network is expected to be used more and more. (A wireless communication network in an ad hoc mode has been proposed in, e.g., Japanese Patent Nos. 02924828 and 03698711, and Japanese Patent Laid-Open No. 2005-045637.)
The wireless LAN has standards such as IEEE802.11. In the standards, ESSID and BSSID are defined as network identifiers to identify a wireless communication network to be built. ESSID is usually set by a user.
For the standards, in an ad hoc mode, an electronic apparatus, which has built a wireless communication network first, determines a network identifier called BSSID of a wireless communication network. The electronic apparatus executing this operation will be referred to as a creator hereinafter.
The second and subsequent electronic apparatuses search for a beacon of the same ESSID, and operate to participate in the wireless communication network by using BSSID contained in the beacon. The electronic apparatus executing this operation will be referred to as a joiner hereinafter.
In the ad hoc mode, however, if these electronic apparatuses do not appropriately perform procedures for building the wireless communication network and participating in the wireless communication network, the plurality of electronic apparatuses may be creators depending on start timings of the wireless communication functions. In this case, even if the same ESSIDs are set, a plurality of wireless communication networks having different BSSIDs are built.
In the prior art, for example, when the wireless communication function of an electronic apparatus starts, the electronic apparatus executes a scan process for inquiring the presence/absence of a wireless communication network around it. When the electronic apparatus receives, as a result of the scan process, a response message representing that a wireless communication network having the same ESSID exists, the electronic apparatus participates in the wireless communication network already built.
Alternatively, when the electronic apparatus does not receive a response message representing that a wireless communication network exists, the electronic apparatus which has executed the scan process becomes a creator, and builds a wireless communication network.
If, however, a plurality of electronic apparatuses simultaneously start their wireless communication functions, they execute scan processes at the same timing. Each electronic apparatus therefore does not receive, from each of other electronic apparatuses, a response message representing that a wireless communication network exists. In this case, each electronic apparatus cannot recognize the existence of other electronic apparatuses having the same ESSIDs and the electronic apparatuses respectively build wireless communication networks having different ESSIDs.
Consequently, a problem arises in that a plurality of electronic apparatuses which are to communicate with each other cannot participate in the same wireless communication network, and cannot communicate with each other. This will be a big obstacle when the plurality of electronic apparatuses attempt to communicate with each other.